//
//  RFBluetoothConfig.m
//  demo
//
//  Created by qianjie on 2019/8/27.
//  Copyright © 2019 Zen. All rights reserved.
//

#import "RFBluetoothConfig.h"

@implementation RFBluetoothConfig

+ (RFBluetoothConfig *)defaultConfig {
    RFBluetoothConfig *config = [[RFBluetoothConfig alloc] init];
    config.serviceUUID = nil;
    config.readCharacteristicUUID = @"49535343-1E4D-4BD9-BA61-23C647249616";
    config.writeCharacteristicUUID = @"49535343-8841-43F4-A8D4-ECBE34729BB3";
    return config;
}

+ (RFBluetoothConfig *)debugConfig {
    RFBluetoothConfig *config = [[RFBluetoothConfig alloc] init];
     config.serviceUUID = @"FF00";
     config.readCharacteristicUUID = @"FF01";
     config.writeCharacteristicUUID = @"FF02";
     return config;
}

- (NSArray<NSUUID *> *)uuids {
    NSMutableArray *uuids = [[NSMutableArray alloc] init];
    if (self.readCharacteristicUUID.length) {
        CBUUID *uuid = [CBUUID UUIDWithString:self.readCharacteristicUUID];
        [uuids addObject:uuid];
    }
    
    if (self.writeCharacteristicUUID.length) {
        CBUUID *uuid = [CBUUID UUIDWithString:self.writeCharacteristicUUID];
        [uuids addObject:uuid];
    }
    
    return uuids.copy;
}

@end
